<script type="text/javascript" src="/static/res/layui/layui.js"></script>

<script>
    const debug = !!'{:env("APP_DEBUG")}'; //开启debug模式后，会自动更新js版本号，方便开发调试，上线后建议关闭
    const static_path = '/static/res/';
    const base_path = '{/}/static/admin/addons/builderPlus/';

    //定义组件
    const component = {
        tables: base_path + '/component/tables',
        edit: base_path + '/component/edit',
    };

    //定义核心模块
    const modules = ['notify', 'methods'];

    //定义扩展模块
    const extendsModules = {
        handle: '{/}/static/admin/js/handle',
        uploadMore: base_path + 'extends/uploadMore/uploadMore',
        sortable: base_path + 'extends/uploadMore/sortable',
        wangEditor: {
            src: '/static/admin/addons/builderPlus/extends/wangEditor/wangEditor.js',
            api: 'wangEditor'
        }
    };
    const modulesPath = {};
    modules.forEach((v, i) => {
        modulesPath[v] = base_path + 'modules/' + v;
    });
    layui.config({version: debug, base: static_path})
        .extend({...modulesPath, ...extendsModules, ...component})
        .use(['index']);

</script>
